from typing import List
class Solution:
    def trans(self,lst:List[int]):
        n = len(lst)
        ans = []
        for i in range(n-1):
            ans.append((lst[i] + lst[i+1])%10)
        return ans
        
    def hasSameDigits(self, s: str) -> bool:
        lst = list(map(int, s))
        while len(lst)>2:
            lst = self.trans(lst)
        return lst[0] == lst[1]